package cn.imokay.pool;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ThreadPoolDemo1 {
    public static void main(String[] args) {
        //1池n线程,不推荐，因为任务队列无边界，可能导致任务一直堆积
        ExecutorService service1 = Executors.newFixedThreadPool(5);
        //1池1线程，不推荐，没必要
        ExecutorService service2 = Executors.newSingleThreadExecutor();
        //1池可扩容，不推荐，可能导致线程数量一直增加
        ExecutorService service3 = Executors.newCachedThreadPool();
        for (int i = 0; i < 5; i++) {
            //service1.ex
        }
    }
}
